#!/usr/bin/make -f

SCONS=scons 
#export DH_VERBOSE=1  
DEB_DESTDIR=$(PWD)/debian/tmp

%:
	dh $@

override_dh_auto_build:
	cd keyvi && $(SCONS) mode=release
	cd python && python setup.py build
override_dh_auto_clean:
	dh_auto_clean
	cd keyvi && $(SCONS) mode=release -c && rm -f .sconsign.dblite
	cd python && rm -rf build && rm -rf keyvi.egg-info
	rm -rf $(DEB_DESTDIR)
	rm -f debian/*.substvars
	rm -f debian/files
	rm -f debian/*.debhelper*

override_dh_auto_install:
	cd keyvi && $(SCONS) mode=release install --prefix=$(DEB_DESTDIR)/usr
	cd python && python setup.py install --install-layout=deb --root $(DEB_DESTDIR)
